<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<!-- manifest="cache.manifest" -->
<head>
    <meta charset="utf-8" />
    <title>{$seo.title}</title>
    <meta name="keywords" content="{$seo.keys}" />
    <meta name="description" content="{$seo.desc}" />
    <link type="text/css" rel="stylesheet"  href="__CSS__/format_dom.css"/>
    <link type="text/css" rel="stylesheet"  href="__CSS__/main.css"/>
    <!--[if lte IE 8]>
    <script src="__JS__/ie/html5shiv.js"></script>
    <![endif]-->
    <!--[if IE 6]>
    <script type="text/javascript" src="__JS__/DD_belatedPNG.js"></script>
    <script type="text/javascript">DD_belatedPNG.fix("*")</script>
    <![endif]-->
    <script src="__PUBLIC__/js/jquery.min.js"></script>
</head>
<body>
<div class="top_bg" style="background-image: url(/static/home/images/top_bg.jpg);">
    <div class="top">
        <span class="logo"><img src="{$site.pcLogo}" width="80" height="64"></span>
        <div class="city_bg">
            <div class="city"><span class="city_span city-box"></span>{$cityInfo.name}</div><a href="javascript:;" class="qh_btn city-box">[切换]</a>
        </div>
        <div class="city_box" id="CPM" style="display:none;">
            <div class="cities-con">
                <p class="tit">选择城市 <a href="{:url('Index/index@www')}" class="gd_btn">更多城市</a></p>
                <ul class="cities-opts clearfix">
                    {volist name='city' id='vo'}
                    <li class="clearfix">
                        <em class="icons">{$key}</em>
                        <p>
                            {volist name='vo' id='val'}
                            <a {if condition="$val.is_hot eq 1"}class="highlight"{/if} href="{:url('Index/index@'.$val['domain'])}">{$val.name}</a>
                            {/volist}
                        </p>
                    </li>
                    {/volist}
                </ul>
                <i></i>
            </div>
            <a href="javascript:;" class="close_btn">×</a>
        </div>
        <div class="ind_login">
            {empty name='userInfo'}
            <a href="{:url('user.login/index')}" class="ind_login01">登录</a>
            <a href="{:url('user.login/reg')}" class="ind_login02">注册</a>
            {else /}
             <span style="color:#ff0000;">{$userInfo.nickname}</span>,欢迎您的到来 <a href="{:url('user.index/index')}">会员中心</a> | <a href="{:url('user.login/logout')}">退出</a>
            {/empty}
        </div>
        <div class="nav">
            <ul>
                {volist name='menu' id='vo'}
                {if condition="$vo.pos eq 1"}
                {notempty name='vo.url'}
                {php}$url = $vo['url'];{/php}
                {else /}
                {notempty name='vo.alias'}{php}$url=url($vo['model'].'/detail',['cate'=>$vo['alias']]);{/php}{else /}{php}$url=url($vo['model'].'/index');{/php}{/notempty}
                {/notempty}
                <li><a href="{$url}" target="{$vo.open_type}" {if condition="$vo.model eq $controller"}class="on"{/if}>{$vo.title}</a></li>
                {/if}
                {/volist}
            </ul>
        </div>

    </div>
    <div class="search">
        <div class="search_body">
            <div class="tab01">
                <ul class="idTabs" id="search-tab">
                    <li><a href="javascript:;" class="selected">新房</a></li>
                    <li><a href="javascript:;">二手房</a></li>
                </ul>
            </div>
            <div id="search-content">
            <div id="tab01">
                <div class="float_r"><a href="{:url('Map/index')}" class="map_but">地图找房</a></div>
                <div class="search_box">
                    <div class="search_input">
                        <form action="{:url('Loupan/index')}" id="info_form">
                        <input name="keyword" type="text" class="s_input" data-uri="{:url('Ajax/autoHouseComplate')}" id="title" placeholder="请输入楼盘名称">
                        <a href="javascript:;" class="but01">搜索</a>
                        </form>
                        <div class="auto-complate">
                            <ul>
                            </ul>
                        </div>
                    </div>
                    <p class="overflow_h">
                        <span>区域：</span>
                        {volist name='area' id='vo'}
                        <i><a href="{:url('Loupan/index',['area'=>$vo['id']])}">{$vo.name}</a></i>
                        {/volist}
                    </p>
                    <p class="overflow_h">
                        <span>价格：</span>
                        {volist name=":getHousePrice()" id='vo'}
                        <i><a href="{:url('Loupan/index',['price'=>$key])}">{$vo.name}</a></i>
                        {/volist}
                    </p>
                </div>
            </div>

            <div id="tab02" style="display:none">
                <div class="float_r"><a href="{:url('Map/second_house')}" class="map_but">地图找房</a></div>
                <div class="search_box">
                    <div class="search_input">
                        <form action="{:url('Second/index')}" id="second-form">
                        <input name="keyword" type="text" class="s_input" data-uri="{:url('Ajax/autoSecondComplate')}" id="stitle" placeholder="请输入房源称">
                        <a href="javascript:;" class="but01">搜索</a>
                        </form>
                        <div class="auto-complate">
                            <ul>
                            </ul>
                        </div>
                    </div>
                    <p class="overflow_h">
                        <span>区域：</span>
                        {volist name='area' id='vo'}
                        <i><a href="{:url('Second/index',['area'=>$vo['id']])}">{$vo.name}</a></i>
                        {/volist}
                    </p>
                    <p class="overflow_h">
                        <span>价格：</span>
                        {volist name=":getSecondPrice()" id='vo'}
                        <i><a href="{:url('Second/index',['price'=>$key])}">{$vo.name}</a></i>
                        {/volist}
                    </p>
                </div>
            </div>
            </div>
        </div>
    </div>
</div>

<div>
    <div class="index_ico">
        <ul>
            <li><span class="index_ico_01"></span><b>上千合作新房楼盘</b><p>上百万真实二手房源任你选</p></li>
            <li><span class="index_ico_02"></span><b>30分钟内快速响应</b><p>线上支付更快捷</p></li>
            <li><span class="index_ico_03"></span><b>专业经纪人一对一服务</b><p>完善的售后服务体系</p></li>
            <li><span class="index_ico_03"></span><b>最高30%团购返现</b><p>二手房成交免过户费</p></li>
        </ul>
    </div>
    {notempty name='group'}
    <div class="i_group overflow_h">
        <div class="i_group_t"><b>团购优惠</b><p>上{$site.title}买房，最高立减30%团购费</p></div>
        <div class="i_group_box ">
            <ul>
                {volist name='group' id='vo'}
                <li>
                    <div class="i_g_img"><a href="{:url('Tuangou/detail',['id'=>$vo['id']])}" title="{$vo.title}"><img src="__IMG__/loading.gif" class="lazy" data-original="{$vo.img}" alt="{$vo.title}" width="280" height="207"></a></div>
                    <b><a href="{:url('Tuangou/detail',['id'=>$vo['id']])}" title="{$vo.title}">{$vo.title}</a></b>
                    <p>团购价：{empty name='vo.price'}暂无报价{else /}{$vo.price}元/㎡{/empty}</p>
                    <p class="text01 nowarp" title="{$vo.youhui}">{$site.title}优惠：{$vo.youhui}</p>
                </li>
                {/volist}

            </ul>
        </div>
    </div>
    {/notempty}
    <div class="cpr">
        <div class="title02"><b>精品推荐</b><p>精品楼盘，只为您推荐</p></div>
        <div class="main">
            <div class="cpr_img">
                <!-- 焦点图 开始 -->
                <div id="fsD1" class="focus" >
                    <div id="D1pic1" class="fPic slides-content">
                        {volist name='new_house' id='vo'}
                        <div class="fcon">
                            <a target="_blank" title="{$vo.title}" href="{:url('Loupan/detail',['id'=>$vo.id])}"><img src="{$vo.img}" alt="{$vo.img}"></a>
                            <span class="shadow"><a target="_blank" href="{:url('Loupan/detail',['id'=>$vo.id])}">{$vo.title}</a></span>
                        </div>
                        {/volist}
                    </div>
                    <div class="fbg">
                        <div class="D1fBt switchable-nav" id="D1fBt">
                        </div>
                    </div>
                    <span class="prev"></span>
                    <span class="next"></span>
                </div>

                <!-- 焦点图 结束 -->
            </div>
            <form action="{:url('Ajax/demand')}" method="post" id="xuqiu_form">
            <div class="cpr_inp">
                <b>发布购房需求</b>
                <p>
                    <select class="c_selsct" name="area" id="area">
                        <option value="0">请选择房屋区域</option>
                        {volist name='area' id='vo'}
                        <option value="{$siteInfo.name}{$vo.name}">{$vo.name}</option>
                        {/volist}
                    </select>
                </p>
                <p>
                    <select class="c_selsct" name="price" id="price">
                        <option value="0">意向价格</option>
                        {volist name=":getSecondPrice()" id='vo'}
                        <option value="{$vo.name}">{$vo.name}</option>
                        {/volist}
                    </select>
                </p>
                <p>
                    <select class="c_selsct" name="mianji" id="mianji">
                        <option value="0">意向面积</option>
                        <option value="50平米以下">50平米以下</option>
                        <option value="50-60平米">50-60平米</option>
                        <option value="60-80平米">60-80平米</option>
                        <option value="80-100平米">80-100平米</option>
                        <option value="100-120平米">100-120平米</option>
                        <option value="120平米以上">120平米以上</option>
                    </select>
                </p>
                <p>
                    <input type="text"  class="c_selsct" name="mobile" id="mobile" style="width:290px;" placeholder="请填写联系电话">
                </p>
                <p><a href="javascript:;" id="demand-btn" class="but02">立即提交</a></p>
            </div>
            </form>
        </div>
    </div>

    <div class="i_h_r overflow_h">
        <div class="i_group_t">
            <b>{$cityInfo.name}新房推荐</b>
        </div>
        <div class="i_h_r01" id="house01">
            <ul class="clearfix">
                {volist name='house_position' id='vo'}
                <li {if condition="$i % 4 neq 0"}class="mar01"{/if}>
                    <div class="i_g_img">
                        <div class="i_h_r01_t"><a href="{:url('Loupan/detail',['id'=>$vo['house_id']])}" title="{$vo.title}">{$vo.title}</a></div>
                        <a href="{:url('Loupan/detail',['id'=>$vo['house_id']])}" title="{$vo.title}"><img src="__IMG__/loading.gif" class="lazy" data-original="{$vo.img}" width="280" height="207"></a>
                    </div>
                    <div class="i_h_r01_t2">
                        <p class="overflow_h"><span><i>{$vo.data.average_price}</i>元/平米</span>{$vo.data.city_name} {$vo.data.area_name}</p>
                        <p style="border-bottom:none">{$vo.data.address}</p>
                    </div>
                </li>
                {/volist}

            </ul>
        </div>
    </div>
    {notempty name='second_position'}
    <div class="i_s_h">
        <div class="i_group_t">
            <b>{$cityInfo.name}二手房推荐</b>
        </div>

        <div class="i_s_h01">
            <ul class="clearfix">
                {volist name='second_position' id='vo'}
                <li {if condition="$i % 4 neq 0"}class="mar01"{/if}>
                    <div class="i_g_img"><a href="{:url('Second/detail',['id'=>$vo['house_id']])}" title="{$vo.title}"><img src="__IMG__/loading.gif" alt="{$vo.title}" class="lazy" data-original="{$vo.img}" width="280" height="207"></a></div>
                    <b><span><i>{$vo.data.total_price}</i>万</span><a href="{:url('Second/detail',['id'=>$vo['house_id']])}" title="{$vo.title}" class="nowarp" style="width:170px;">{$vo.title}</a></b>
                    <p>{$vo.data.city_name}{$vo.data.area_name}  {$vo.data.room}房{$vo.data.ting}厅 {$vo.data.mianji}m<sup>2</sup></p>
                </li>
                {/volist}
            </ul>
        </div>
    </div>
    {/notempty}
</div>
{include file='public/footer'}
<script type="text/html" id="template">
    {{# for(var i = 0,len = d.length;i < len;i++){ }}
    <li>
        <a href="{{d[i].url}}" title="{{d[i].title}}">
            <div>{{d[i].title}}(<span>{{d[i].price}}元/m<sup>2</sup></span>)</div>
            <div class="address">{{d[i].address}}</div>
        </a>
    </li>
    {{# } }}
</script>
<script src="__PUBLIC__/js/plugins/jquery.slide-packer.js"></script>
<script src="__PUBLIC__/js/plugins/jquery.ajax.form.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/layer/laytpl.js"></script>
<script>
    $(function(){
        $('.but01').bind('click',function(){
           var keyword = $(this).parent().find($('input[name="keyword"]')).val();
            if(keyword.length == 0){
                layer.msg('请填写关键词',{icon:2});
            }else{
                $(this).parent('form').submit();
            }
        });
        $("input[name='keyword']").bind('keyup',function(){
            var url = $(this).data('uri'),keyword = $.trim($(this).val()),me=$(this);
            if(keyword.length == 0){
                layer.msg('请输入关键词',{icon:2});
                return false;
            }
            var param = {keyword: keyword};
            $.get(url,param,function(data){
                var box = me.parents('.search_input').find('.auto-complate');
                if(data.status == 1){
                    if(data.data){
                        box.show();
                        var gettpl = document.getElementById('template').innerHTML;
                        laytpl(gettpl).render(data.data, function(html){
                            box.find('ul').html(html);
                        });
                    }else{
                        box.hide().find('ul').html('');
                    }
                }else{
                    box.hide().find('ul').html('');
                }
            });
        });
        $('#fsD1').slide({
            effect: 'fade',
            speed: 500,
            contentCls: 'slides-content',
            prevBtnCls: 'prev',
            nextBtnCls: 'next',
            evtype: 'mouse'
        });
        $('#search-tab li').bind('click',function(){
            var index = $(this).index();
            $(this).find('a').addClass('selected').parent().siblings().find('a').removeClass('selected');
            $('#search-content').children().eq(index).show().siblings().hide();
        });
        $('#demand-btn').bind('click',function(){
            var area = $('#area').val(),mianji = $('#mianji').val(),price = $('#price').val(),mobile = $('#mobile').val();
            if(area == 0){
                layer.msg('请选择区域！',{icon:2});
                return false;
            }
            if(mianji == 0){
                layer.msg('请选择面积！',{icon:2});
                return false;
            }
            if(price == 0){
                layer.msg('请选择价格！',{icon:2});
                return false;
            }
            if(!/^1[34578][0-9]{9}$/.test(mobile)){
                layer.msg('请填写正确的手机号码！',{icon:2});
                return false;
            }
            $('#xuqiu_form').submit();
        });
        $('#xuqiu_form').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
            if(result.status == 1){
                layer.msg(result.msg,{icon:1});
                setTimeout(function(){
                    window.location.href = location.href + '?t='+Math.random();
                },3000);
            } else {
                layer.msg(result.msg,{icon:2});
            }
        }
    });
</script>
</body>
</html>
